import request from "./request"
import Qs from 'qs'

const FORM = { 'Content-Type': 'application/x-www-form-urlencoded' }
const JSON = { 'Content-Type': 'application/json' }
const FORMDATA = { 'Content-Type': 'multipart/form-data' }



// =================商户账户信息=====================
// 查询商铺列表
export const shopList = data => {
    return request({ url: "/shopAdmin/getAdminSubordinateShopInfo", method: "get", params: data,headers:FORM })
}

// 商户登录
export const login = data => { return request({ url: "/login/doing", method: "post", data: Qs.stringify(data),headers:FORM }) }

// 注销登录
export const loginOut = data => { return request({ url: "/login/logout", method: "post", data: Qs.stringify(data),headers:FORM }) }

//账户信息查询
export const accountInquiry = data => { return request({ url: "/shop/capital/get", method: "get", data: Qs.stringify(data) }) }




// =================实名信息=====================
//实名认证
export const verified = data => { return request({ url: "/shopRealName/doing", method: "post", data: Qs.stringify(data),headers:FORM }) }

//实名认证查询
export const verifiedView = data => { return request({ url: "/shopRealName/getInfo", method: "get", data: Qs.stringify(data),headers:JSON }) }






// =================银行卡=====================
//查询
export const bankcardList = data => { return request({ url: "/shopBankCard/info", method: "get", data: Qs.stringify(data),headers:FORM }) }

//是否绑定
export const isBinding = data => { return request({ url: "/shopBankCard/isBinding", method: "get", data: Qs.stringify(data),headers:FORM }) }

//绑定
export const bankcard = data => { return request({ url: "/shopBankCard/binding", method: "post", data: Qs.stringify(data),headers:FORM }) }

//解绑
export const unBinding = data => { return request({ url: "/shopBankCard/unBinding", method: "post", data: Qs.stringify(data),headers:FORM }) }



// =================支付密码相关=====================
//获取支付密码
export const getPassword = data => { return request({ url: "/shop/capital/get", method: "get", data: Qs.stringify(data),headers:FORM }) }

//是否设置支付密码
export const isSetPayPwd = data => { return request({ url: "/shop/capital/isSetPayPwd", method: "get", data: Qs.stringify(data),headers:FORM }) }

//设置支付密码
export const setPayPwd = data => { return request({ url: "/shop/capital/setPayPwd", method: "post", data: Qs.stringify(data),headers:FORM }) }

//修改支付密码
export const updatePayPwd = data => { return request({ url: "/shop/capital/updatePayPwd", method: "post", data: Qs.stringify(data),headers:FORM }) }

//验证支付密码
export const payPwdIsRight = data => { return request({ url: "/shop/capital/payPwdIsRight", method: "post", data: Qs.stringify(data),headers:FORM }) }


// =================商铺信息=====================
//查询商铺信息
export const shopInfo = data => { return request({ url: "/shop/info", method: "get", data: Qs.stringify(data),headers:FORM }) }

//修改商铺信息
export const shopUpdate = data => { return request({ url: "/shop/update", method: "post", data: Qs.stringify(data),headers:FORM }) }


// =================商品信息=====================
//查询商品分类
export const goodsTypesList = data => { return request({ url: "/goodsTypes/list", method: "get", data: Qs.stringify(data),headers:FORM }) }

//新增商品分类
export const goodsTypesAdd = data => { return request({ url: "/goodsTypes/add", method: "post", data: Qs.stringify(data),headers:FORM }) }

//修改商品分类
export const goodsTypesUpdate = data => { return request({ url: "/goodsTypes/update", method: "post", data: Qs.stringify(data),headers:FORM }) }

//删除商品分类
export const goodsTypesDelete = data => { return request({ url: "/goodsTypes/delete", method: "post", data: Qs.stringify(data),headers:FORM }) }





//查询商品列表
export const goodsList = data => { return request({ url: "/goods/list", method: "get", data: Qs.stringify(data),headers:FORM }) }
//新增商品
export const goodsAdd = data => { return request({ url: "/goods/add", method: "post", data: Qs.stringify(data),headers:FORM }) }
//修改商品
export const goodUpdate = data => { return request({ url: "/goods/update", method: "post", data: Qs.stringify(data),headers:FORM }) }





//查询规格列表
export const specList = data => { return request({ url: "/specifications/list", method: "get", data: Qs.stringify(data),headers:FORM }) }

//新增规格
export const specAdd = data => { return request({ url: "/specifications/add", method: "post", data: data,headers:JSON }) }

//修改规格
export const specUpdate = data => { return request({ url: "/specifications/update", method: "post", data:data,headers:JSON }) }








// =================短信验证码=====================
//修改店铺联系方式发送验证码
export const updateShopPhoneSendSmsYzm = data => { return request({ url: "/sms/updateShopPhoneSendSmsYzm", method: "post", data: Qs.stringify(data),headers:FORM }) }

//加入店铺发送验证码
export const joinShopSendSmsYzm = data => { return request({ url: "/sms/joinShopSendSmsYzm", method: "post", data: Qs.stringify(data),headers:FORM }) }

//管理员修改手机发送验证码
export const adminUpdatePhoneSendSmsYzm = data => { return request({ url: "/sms/adminUpdatePhoneSendSmsYzm", method: "post", data: Qs.stringify(data),headers:FORM }) }

//管理员修改登录密码发送验证码
export const adminUpdateLoginPwdSendSmsYzm = data => { return request({ url: "/sms/adminUpdateLoginPwdSendSmsYzm", method: "post", data: Qs.stringify(data),headers:FORM }) }

//管理员忘记登录密码重置发送验证码
export const adminForgetLoginPwdReSetSendSmsYzm = data => { return request({ url: "/sms/adminForgetLoginPwdReSetSendSmsYzm", method: "post", data: Qs.stringify(data),headers:FORM }) }










